package com.whc.gulimall.authserver.feign;

import com.whc.common.utils.R;
import com.whc.gulimall.authserver.vo.LoginVo;
import com.whc.gulimall.authserver.vo.RegisterVo;
import com.whc.gulimall.authserver.vo.SocialUserVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 会员-远程调用
 *
 * @author angaoen
 */
@FeignClient(name = "gulimall-member", path = "/member/member")
public interface MemberFeign {

    /**
     * 注册
     *
     * @param vo vo
     * @return 统一返回结果
     */
    @PostMapping("/regist")
    R register(@RequestBody RegisterVo vo);

    /**
     * 登录
     *
     * @param vo vo
     * @return 统一返回结果
     */
    @PostMapping("/login")
    R login(@RequestBody LoginVo vo);

    /**
     * oauth2登录
     *
     * @param socialUserVo 社交用户登录
     * @return 统一返回结果
     */
    @PostMapping("/oauth2/login")
    R oathTwoLogin(@RequestBody SocialUserVo socialUserVo);
}
